Bug 2019532: Logger object in LSO does not log source location accurately#299
Conversation
|
@dobsonj: This pull request references Bugzilla bug 2019532, which is invalid:
Comment DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dobsonj The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/bugzilla refresh |
|
@dobsonj: This pull request references Bugzilla bug 2019532, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker. 3 validation(s) were run on this bug
Requesting review from QA contact: DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
sample log file from these changes after adding a couple of LV's and enabling discovery: |
|
I ended up stashing the NewDelegatingLogger implementation on a separate branch, if that seems better: |
|
/bugzilla refresh The requirements for Bugzilla bugs have changed (BZs linked to PRs on master branch need to target OCP 4.11), recalculating validity. |
|
@openshift-bot: This pull request references Bugzilla bug 2019532, which is invalid:
Comment DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
3dc36ac to
9566291
Compare
|
/hold |
|
/cc @gnufied |
| }) | ||
| if opRes != controllerutil.OperationResultNone { | ||
| pvLogger.Info("pv changed", "operation", opRes) | ||
| klog.Infof("PV changed, name = %s, status = %s", pvName, opRes) |
There was a problem hiding this comment.
Could we use InfoS in these places?
There was a problem hiding this comment.
klog doesn't have any structured logging functions that I could find... at least not this version of it. Am I missing something obvious?
There was a problem hiding this comment.
Ah, that was added in klog v2 it looks like, and LSO is still on v1:
$ grep klog go.mod
k8s.io/klog v1.0.0
There was a problem hiding this comment.
hmm okay. Lets handle this later.
There was a problem hiding this comment.
Hold on, I made the changes, but need to retest.
| logger.Error(err, " error creating local-storage directory ", "symLinkLocation", r.symlinkLocation) | ||
| os.Exit(-1) | ||
| klog.ErrorS(err, "error creating local-storage directory", "symLinkLocation", r.symlinkLocation) | ||
| return ctrl.Result{}, err |
There was a problem hiding this comment.
This is buried in the logging changes, so I just want to point out the os.Exit call I removed here--that seemed very wrong to me.
There was a problem hiding this comment.
I distinctly remember spotting this during review, but at that time my thinking was - if we can't create local-storage root directory, something is indeed wrong with the configuration/node and exiting here will cause pod to crash loop and throw easy to spot errors that might be helpful (basically complain as loudly as we can, if things aren't really working).
|
/bugzilla refresh |
|
@dobsonj: This pull request references Bugzilla bug 2019532, which is valid. 3 validation(s) were run on this bug
Requesting review from QA contact: DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
/lgtm |
|
@dobsonj: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
|
@dobsonj: All pull requests linked via external trackers have merged: Bugzilla bug 2019532 has been moved to the MODIFIED state. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
/cherry-pick release-4.10 |
|
@dobsonj: new pull request created: #317 DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
See https://bugzilla.redhat.com/show_bug.cgi?id=2019532
/cc @openshift/storage